linux_gntshr_munmap: munmap takes a length, not a page count
authorDavid Scott <dave.scott@citrix.com>
Wed, 3 Sep 2014 17:34:21 +0000 (18:34 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 10 Sep 2014 14:06:50 +0000 (15:06 +0100)
commit7f6b3ca54de7603d5042c2ba73c07fb23f135f8e
tree58303bfd864b4dc8c9ab9a3641f42036e7e68972
parent0bf8ddecb4df674a9df976f349c98691b2560721
linux_gntshr_munmap: munmap takes a length, not a page count

This fixes a bug where if a client shares more than 1 page, the
munmap call fails to clean up everything. A process which does
a lot of sharing and unsharing can run out of resources.

This patch also fixes in-tree callers of
  - xc_gntshr_munmap
  - xc_gnttab_munmap
to supply page counts rather than lengths.

Signed-off-by: David Scott <dave.scott@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libvchan/init.c
tools/libvchan/io.c
tools/libxc/xc_linux_osdep.c